package com.meimeixia.pattern.singleton.demo4;

/**
 * @author liayun
 * @create 2021-05-29 19:01
 */
public class Client2 {
    public static void main(String[] args) {
        Singleton2 instance = Singleton2.getInstance();
        Singleton2 instance1 = Singleton2.getInstance();
        System.out.println(instance == instance1);//true
    }
    /*以上就是双重检查锁方式的标准代码。现在再去运行Client测试类，打印的结果肯定是true，这是毋庸置疑的。*/
}
